import { Swiper } from "antd-mobile"
import axios from "axios"
import React,{useState,useEffect} from "react"
const Sw=()=>{
    const [data,setData]=useState([])
    const getDate=async()=>{
        const res=await axios.get('/api/swiper')
        setData(res.data.data)
        console.log(res);
        
    }
    useEffect(()=>{
        getDate()
    },[])
    return <div>
        <Swiper autoplay>
            {
                data.map(item=><Swiper.Item key={item.id}>
                    <img src={item.image} alt="" style={{width:'100%'}}/>
                </Swiper.Item>)
            }
        </Swiper>
    </div>
}
export default Sw